#!/bin/sh

# kernel version must be supplied
[ $# -lt 1 ] && exit 0

clean_initramfs() {
    rm -f "/boot/initramfs-$1.img"
    rm -f "/boot/initrd.img-$1"
}

if [ "$#" -eq 1 -o "$2" = "$1" ]; then
    clean_initramfs "$1"
else
    clean_initramfs "$1"
    clean_initramfs "$2"
fi
